package jd;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    @org.junit.Test
    public void test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("jd.xml");
        Player zhangsan = (Player) context.getBean("zhangsan");
       /*System.out.println(zhangsan.getRing().getName()+"[速度增效:"+zhangsan.getRing().getSpeedPlus()
        +"攻击增效:"+zhangsan.getRing().getAttackPlus()+"防御增效:"+zhangsan.getRing().getDefencePlus()+"]");*/

        /*System.out.println(JSON.toJSONString(zhangsan));*/

        Equip equip = new Equip();
        equip.setType("指环");
        equip.setAttackPlus(zhangsan.getRing().getAttackPlus());
        equip.setDefencePlus(zhangsan.getRing().getDefencePlus());
        equip.setName(zhangsan.getRing().getName());


        Equip ring = zhangsan.updateEquip(equip);

        System.out.println(zhangsan.getRing());
    }
}
